package net.lahuobao.enums.mall.admin;

/**
 * Created by Administrator on 2017/1/19.
 */
public enum EMallOrderType {
    B2C {
        public int getValue() {
            return 0;
        }

        public String getName() {
            return "线上商城订单";
        }
    },
    O2O {
        public int getValue() {
            return 1;
        }

        public String getName() {
            return "本地服务订单";
        }
    },
    VIRTUAL {
        public int getValue() {
            return 2;
        }

        public String getName() {
            return "在线充值服务订单";
        }
    };


    public static String valueOf(int value) {
        switch (value) {
            case 0:
                return EMallOrderType.B2C.getName();
            case 2:
                return EMallOrderType.VIRTUAL.getName();
            case 1:
                return EMallOrderType.O2O.getName();
        }
        return null;
    }

    public static EMallOrderType getEMallOrderType(int value) {
        switch (value) {
            case 0:
                return EMallOrderType.B2C;
            case 2:
                return EMallOrderType.VIRTUAL;
            case 1:
                return EMallOrderType.O2O;
        }
        return null;
    }

    public abstract int getValue();

    public abstract String getName();
}
